function submitSearch()
{
    $("#searchTable").submit();
}

function resetSearch()
{
    $("#select_businessName").textbox("setValue","");
    $("#select_custName").textbox("setValue","");
    $("#select_tradeCode").textbox("setValue","");
    $("#select_time").textbox("setValue","");
    $("#select_payState").combobox("setValue","");
    $("#select_tradeState").combobox("setValue","");
}

//		function formatAction(value,row,index)
//		{
//			if (row.contract_annex)
//			{
//				var a = '<input type="button" value="修改合同" class="input" onclick="uploadfile('+row.id+');">';
//			}
//			else
//			{
//				var a = '<input type="button" value="上传合同" class="input" onclick="uploadfile('+row.id+');">';
//			}
//			var b = '<input type="button" value="详情" class="input" onclick="trade_detail('+row.id+');">';
//			return a+'&nbsp;&nbsp;'+b;
//		}

function trade_detail() {
    var obj=$("#default_table").datagrid('getSelected');
    //console.log($('#customer_table').datagrid('getPager').data("pagination").options.pageNumber);
    if(obj==null){
        alert("请选择借款订单！");
        return;
    }
    var id=obj.id;
    window.parent.addTab('订单详情','../../order/order/order_see?id='+id);
}

function order_add() {
    window.parent.addTab("新增订单","../../order/order/order_add");
}

function uploadfile() {
    var obj=$("#default_table").datagrid('getSelected');
    //console.log($('#customer_table').datagrid('getPager').data("pagination").options.pageNumber);
    if(obj==null){
        alert("请选择借款订单！");
        return;
    }
    var id=obj.id;
    $("#trade_id").val(id);
    $("#uploadfile").click();
}

function changupload()
{
    var formData = new FormData($('#fileForm')[0]);
    $("#fileForm").submit();
}